import { IConifg } from "@lgq/types";
import requset from "@lgq/utils/request";

const get = <T>(
  url: string,
  params?: object,
  options: IConifg = { showLoading: true, showError: true }
): Promise<T> => {
  return requset.get(url, { params, ...options });
};

const post = <T>(
  url: string,
  data?: object,
  options: IConifg = { showLoading: true, showError: true }
): Promise<T> => {
  return requset.post(url, data, options);
};

export default {
  get,
  post,
};
